public class MethodTotal {

        //修饰符 返回值类型 名称（形参……）{return 返回值；}
    //方法在类里面，方法里有局部变量
        public static boolean isLeapYear(int year){//形参
            if ((0==year%4&&0!=year%100)||0==year%400){
                System.out.println(year+"年是闰年");
                return true;
            }else {
                System.out.println(year+"年不是闰年");
                return false;
            }
        }
        public static int FacNum(int num){
            int sum=0;
            for (int i = 0; i <=num; i++) {
                //int ret=Fac(i);
                sum+=Fac(i);
            }

            return sum;
        }
        public static int Fac(int n){
            int ret=1;
            for (int i = 1; i <=n; i++) {
                ret*=i;//ret=ret*i
            }
            return ret;
        }
        public static void swap(int a,int b){
            int tmp=a;
            a=b;
            b=tmp;
        }
        public static void main(String[] args) {
           /* boolean flg=isLeapYear(2000);//实参
            System.out.println(flg);*/


        }
}
